package com.tencreat.service.mall;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.domain.model.LoginUser;
import com.tencreat.common.core.domain.model.ReqIdParam;
import com.tencreat.common.core.domain.model.ReqIdsParam;
import com.tencreat.common.core.domain.model.ReqStringParam;
import com.tencreat.common.enums.BalanceTypeEnum;
import com.tencreat.domain.account.vo.AccountRechargeRecordVo;
import com.tencreat.domain.mall.GoodsRollOrder;
import com.tencreat.domain.mall.RechargeOrder;
import com.tencreat.domain.mall.RechargePackage;
import com.tencreat.domain.mall.vo.IntegralStatisticsVO;
import com.tencreat.domain.mall.vo.ResBalanceRecordVO;
import com.tencreat.domain.mall.vo.ResMyPurseInfoVO;
import com.tencreat.domain.mall.dto.BalanceRecordDTO;
import com.tencreat.domain.mall.dto.RechargeOrderDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 充值(提现)订单Service接口
 *
 * @author wangkai
 * @date 2021-11-13
 */
public interface IRechargeOrderService extends IService<RechargeOrder> {
    /**
     * 查询充值(提现)订单
     *
     * @param orderId 充值(提现)订单ID
     * @return 充值(提现)订单
     */
    RechargeOrder selectRechargeOrderById(ReqIdParam orderId);

    /**
     * 查询充值(提现)订单列表
     *
     * @param rechargeOrder 充值(提现)订单
     * @return 充值(提现)订单集合
     */
    List<RechargeOrder> selectRechargeOrderList(RechargeOrder rechargeOrder);

    /**
     * 新增充值(提现)订单
     *
     * @param rechargeOrder 充值(提现)订单
     * @return 结果
     */
    int insertRechargeOrder(RechargeOrder rechargeOrder);

    /**
     * 修改充值(提现)订单
     *
     * @param rechargeOrder 充值(提现)订单
     * @return 结果
     */
    int updateRechargeOrder(RechargeOrder rechargeOrder);

    /**
     * 批量删除充值(提现)订单
     *
     * @param orderIds 需要删除的充值(提现)订单ID
     * @return 结果
     */
    int deleteRechargeOrderByIds(ReqIdsParam orderIds);

    /**
     * 删除充值(提现)订单信息
     *
     * @param orderId 充值(提现)订单ID
     * @return 结果
     */
    int deleteRechargeOrderById(ReqIdParam orderId);

    /**
     * APP端充值
     *
     * @param vo
     * @param loginCheck
     * @return
     */
    HttpResult<?> recharge(RechargeOrderDTO vo, Long uuid, LoginUser loginCheck) throws Exception;

    List<AccountRechargeRecordVo> rechargeRecordList(LoginUser loginCheck);

    /**
     * PC端充值
     *
     * @param map
     * @return
     */
    HttpResult<?> pcRecharge(Map<String, Object> map);


    /**
     * pc余额记录
     *
     * @param page
     * @param params
     * @return
     */
    Page<ResBalanceRecordVO> balanceRecordPage(IPage<ResBalanceRecordVO> page, BalanceRecordDTO params);


    /**
     * 我的钱包
     *
     * @param uuid
     * @return
     */
    ResMyPurseInfoVO getMyPurseInfo(Long uuid);

    /**
     * app端余额支付密码验证
     *
     * @param id
     * @param loginCheck
     * @return
     */
    HttpResult<?> balanceValidation(ReqStringParam id, LoginUser loginCheck);

    IntegralStatisticsVO balanceStatistics(Integer balanceType);


    List<RechargePackage> getRechargePackageList();

    RechargePackage selectrRechargePackage(BigDecimal money);

    IPage<GoodsRollOrder> goodsRollRecordPage(Page<GoodsRollOrder> page, BalanceRecordDTO params);

    HttpResult<GoodsRollOrder> updateGoodsRollRecord(GoodsRollOrder params);

    BigDecimal rechargeAmount();
}
